<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org" lang="en">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="renderer" content="webkit">
    <title>数据采集平台</title>
    <link rel="shortcut icon" href="static/img/favicon.ico">
    <link href="static/css/bootstrap.min.css?v=3.3.6" rel="stylesheet">
    <link href="static/css/font-awesome.min.css?v=4.4.0" rel="stylesheet">
    <link href="static/css/animate.css" rel="stylesheet">
    <link href="static/css/style.css?v=4.1.0" rel="stylesheet">
    <style type="text/css">
        .layui-bg-primary {
            background: #2667DF;
        }

        .layui-logo a {
            color: #FFFFFF;
            font-size: 20px;
            font-weight: bold;
            line-height: 57px;
            margin-left: 20px;
        }

        .layuiNavFirst {
            background: #2667DF;
        }

        .layuiNavFirst li a {
            font-size: 16px;
            color: #FFFFFF !important;
        }

        /* 修改导航栏的选中样式 */
        .layuiNavFirst .layui-nav-bar {
            background-color: #FFFFFF;
        }

        .layuiNavColor .layui-nav-item a:hover {
            font-weight: bold;
        }

        .layuiNavColorA {
            font-weight: bold;
        }

        /* 二级导航条 */
        .header-header {
            background: #FFFFFF;
            height: 45px;
            line-height: 45px;
            border-top: 1px solid #E4E4E4;
            border-bottom: 1px solid #E4E4E4;
            padding: 0px 10px 0px 25px;
        }

        .layuiNavSectend li a {
            font-size: 14px !important;
            height: 45px;
            line-height: 45px;
            display: block;
            float: left;
            padding: 0px 20px;
            color: #333333;
            margin-left: 10px;
        }

        .layuiNavSectend li a:hover {
            color: #2667DF;
            border-bottom: 3px solid #2667DF !important;
        }

        .layuiNavSectendLiA {
            color: #2667DF !important;
            border-bottom: 3px solid #2667DF !important;
        }


        #page-wrapper {
            margin: 0 0 0 0;
            height: auto;
            min-height: 100%;
            background: #F5F6FA;
        }

        #content-main {
            height: calc(100% - 150px);
            overflow-x: hidden;
            overflow-y: auto;
        }

        .content-tabs {
            border-bottom: solid 1px #E4E4E4;
            height: 0px;
            line-height: 0px;
        }

        .page-tabs a.active {
            background: #2667DF !important;
            color: #FFFFFF;
        }

        .page-tabs a.active:hover {
            background: #1530df !important;
        }

        .navbar-KUser {
            font-size: 16px;
            font-weight: bold;
        }
    </style>
</head>
<body class="fixed-sidebar full-height-layout gray-bg" style="overflow:hidden">
<div style="overflow: hidden;" id="wrapper">
    <!--导航开始-->
    <div class="layui-header layui-bg-primary">
        <div class="layui-logo">
            <a href=""><img src="../img/logo_zh.png"></a>
        </div>
        <!-- 头部区域（可配合layui已有的水平导航） -->
        <ul class="layui-nav layui-layout-left layuiNavFirst layuiNavColor">
            <li class="layui-nav-item" lay-unselect><a id="1" class="layuiNavColorA" href="javascript:;">首页</a></li>
            <li class="layui-nav-item" lay-unselect><a id="2" href="javascript:;">资源库管理</a></li>
            <li class="layui-nav-item" lay-unselect><a id="7" href="javascript:;">数据整合</a></li>
            <li class="layui-nav-item" lay-unselect><a id="3" href="javascript:;">定时策略</a></li>
            <li class="layui-nav-item" lay-unselect>
                <a id="4" href="javascript:;">任务管理</a>
            </li>
            <li class="layui-nav-item" lay-unselect>
                <a id="5" href="javascript:;">监控管理</a>
            </li>
            <li class="layui-nav-item" lay-unselect>
                <a id="6" href="javascript:;">用户管理</a>
            </li>
        </ul>

        <ul style="height: 60px;" class="layui-nav layui-layout-right layuiNavFirst">
            <span class="navbar-KUser"></span>
            <li class="layui-nav-item">
                <a onclick="logout()" class=""><i class="fa fa fa-sign-out"></i> 退出</a>
            </li>
        </ul>
    </div>
    <div class="header-header">
        <ul class="layuiNavSectend">
            <div class="headerNav" id="headerNav1">
                <li>
                    <a class="J_menuItem layuiNavSectendLiA" href="/main.html">&nbsp;首页</a>
                </li>
            </div>
            <div class="headerNav" style="display: none;" id="headerNav2">
                <li>
                    <a class="J_menuItem" href="/repository/list.html">&nbsp;资源库列表</a>
                </li>
                <!--<li>
                    <a class="J_menuItem" href="/dataResource/dataSource.html">&nbsp;数据源列表</a>
                </li>-->
            </div>
            <div class="headerNav" style="display: none;" id="headerNav7">
                <li>
                    <a class="J_menuItem" href="/dataResource/dataMenuIndex.html">&nbsp;整合列表</a>
                </li>
            </div>
            <div class="headerNav" style="display: none;" id="headerNav3">
                <li>
                    <a class="J_menuItem " href="/quartz/list.html">&nbsp;定时策略</a>
                </li>
            </div>
            <div class="headerNav" style="display: none;" id="headerNav4">
                <li>
                    <a class="J_menuItem" href="/trans/list.html">&nbsp;采集管理</a>
                </li>
                <li>
                    <a class="J_menuItem " href="/category/list.html">&nbsp;任务分类</a>
                </li>
                <!--<li>-->
                <!--<a class="J_menuItem" th:href="@{/web/job/list.shtml}" href="/job/list.html">&nbsp;作业管理</a>-->
                <!--</li>-->

            </div>
            <div class="headerNav" style="display: none;" id="headerNav5">
                <!--<li>-->
                <!--<a class="J_menuItem layuiNavSectendLiA" th:href="@{/web/job/monitor/list.shtml}" href="/job/monitor/list.html">&nbsp;作业监控</a>-->
                <!--</li>-->
                <li>
                    <a class="J_menuItem" href="/monitor/t-list.html">&nbsp;任务监控</a>
                </li>
            </div>
            <div class="headerNav" style="display: none;" id="headerNav6">
                <li>
                    <a class="J_menuItem layuiNavSectendLiA" href="/user/list.html">&nbsp;用户列表</a>
                </li>
            </div>
        </ul>
    </div>
    <!--导航结束-->
    <!--右侧部分开始-->
    <div id="page-wrapper" class="gray-bg dashbard-1">
        <!--<div class="row border-bottom">
           <nav class="navbar navbar-static-top" role="navigation" style="margin-bottom: 0">
               <div class="navbar-header">
                   <a class="navbar-minimalize minimalize-styl-2 btn btn-primary " href="javascript:void(0)"><i class="fa fa-bars"></i></a>
                   <div class="navbar-title">数据采集平台</div>
               </div>

           </nav>
       </div>-->
        <div class="row content-tabs">
            <!-- <button class="roll-nav roll-left J_tabLeft"><i class="fa fa-backward"></i></button>
            <nav class="page-tabs J_menuTabs">
                <div class="page-tabs-content">
                    <a th:href="@{/web/main.shtml}" href="/web/main.shtml" class="active J_menuTab" data-id="web/main.shtml">首页</a>
                </div>
            </nav>
            <button class="roll-nav roll-right J_tabRight"><i class="fa fa-forward"></i></button>
            <div class="btn-group roll-nav roll-right">
                <button class="dropdown J_tabClose" data-toggle="dropdown">关闭操作<span class="caret"></span></button>
                <ul role="menu" class="dropdown-menu dropdown-menu-right">
                    <li class="J_tabShowActive">
                        <a>定位当前选项卡</a>
                    </li>
                    <li class="divider"></li>
                    <li class="J_tabCloseAll">
                        <a>关闭全部选项卡</a>
                    </li>
                    <li class="J_tabCloseOther">
                        <a>关闭其他选项卡</a>
                    </li>
                </ul>
            </div> -->
            <!-- <a onclick="logout()" class="roll-nav roll-right J_tabExit"><i class="fa fa fa-sign-out"></i> 退出</a> -->
        </div>
        <div class="row J_mainContent" id="content-main">
            <iframe class="J_iframe" name="iframe0" width="100%" height="100%" th:src="@{/web/main.shtml}"
                    src="/main.html" frameborder="0" seamless></iframe>
        </div>
        <div class="footer">
            <div class="copy-right"></div>
        </div>
    </div>
    <!--右侧部分结束-->
</div>
<!-- 全局js -->
<script src="static/js/jquery.min.js?v=2.1.4"></script>
<script src="static/js/bootstrap.min.js?v=3.3.6"></script>
<script src="static/js/plugins/metisMenu/jquery.metisMenu.js"></script>
<script src="static/js/plugins/slimscroll/jquery.slimscroll.min.js"></script>
<script src="static/js/plugins/layer/layer.min.js"></script>
<!-- ECharts -->
<script src="static/js/plugins/echarts/echarts.js"></script>
<!-- 第三方插件 -->
<script type="text/javascript" src="static/js/plugins/pace/pace.min.js"></script>
<!-- 自定义js -->
<script type="text/javascript" src="static/js/hplus.js?v=4.1.0"></script>
<script type="text/javascript" src="static/js/contabs.js"></script>
<script>
    $(document).ready(function () {
        $('.layuiNavColor li a').click(function () {
            $(this).addClass("layuiNavColorA").closest("li").siblings("li:has(a.layuiNavColorA)").children("a").removeClass(
                "layuiNavColorA");
            var id = $(this).attr("id");
            var head = $('#headerNav' + id);
            head.show().siblings().hide();
            head.children("li").children("a").first().click();
        });

        $('.headerNav li a').click(function () {
            $(this).addClass("layuiNavSectendLiA").closest("li").siblings("li:has(a.layuiNavSectendLiA)").children("a").removeClass(
                "layuiNavSectendLiA");
        });

        // 根据用户名查询用户信息显示
        getUserInfo();
        /*判断是否为管理员*/
        isAdmin();
    });

    function isAdmin() {
        var username = window.localStorage.getItem("username");
        if ('admin' !== username) {
            $("#isAdmin").hide();
        }
    }

    /*退出登录*/
    function logout() {
        $.ajax({
            type: 'GET',
            async: false,
            url: '/dataCollection/login/out',
            success: function (res) {
                if (!res.success) {
                    alert(res.message);
                } else {
                    window.localStorage.clear();
                    window.location.replace("/");
                }
            },
            error: function () {
                alert("请求失败！请刷新页面重试");
            },
            dataType: 'json'
        });
    }

    function getUserInfo() {
        var username = window.localStorage.getItem("username");
        if ('' == username || null == username) {
            return;
        }
        $.ajax({
            type: 'GET',
            async: false,
            url: '/dataCollection/user/getUserByUsername.do?username=' + username,
            success: function (res) {
                if (!res.success) {
                    alert(res.message);
                } else {
                    $(".navbar-KUser").text('你好, ' + res.result.nickname);
                    window.localStorage.setItem('userInfo', JSON.stringify(res.result));
                }
            },
            error: function () {
                alert("请求失败！请刷新页面重试");
            },
            dataType: 'json'
        });
    }
</script>
</body>
</html>
